package com.jimmy.medical.entity;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.util.Date;

/**
 * 通话记录
 *
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "phone_call")
public class PhoneCall extends AbstractEntity {
    /**
     * 通话时长
     */
    @Column(name = "time", length = 200)
    private Integer time;
    /**
     * 电话号码
     */
    @Column(name = "mobile", length = 20)
    private String mobile;
    /**
     * 关联订单
     */
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "flow_order_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private FlowOrder flowOrder;

    /**
     * 拨号时间
     */
    @Column(name = "call_time", length = 20)
    private Date callTime;

    /**
     * 业务类型：1致电客户 2电话告知
     */
    @Column(name = "type", length = 1)
    private String type;

    /**
     * 操作用户
     */
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private User user;

    /**
     * 工单id
     */
    @Transient
    private Long orderId;

    @Transient
    private Long userId;

    /**
     * yyyy-MM-dd HH:mm:ss
     */
    @Transient
    private String normalCallTime;



    /**
     * 是否需要致电客户
     */
    @Transient
    private Integer isNeedDailToMember;

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public FlowOrder getFlowOrder() {
        return flowOrder;
    }

    public void setFlowOrder(FlowOrder flowOrder) {
        this.flowOrder = flowOrder;
    }

    public Date getCallTime() {
        return callTime;
    }

    public void setCallTime(Date callTime) {
        this.callTime = callTime;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getIsNeedDailToMember() {
        return isNeedDailToMember;
    }

    public void setIsNeedDailToMember(Integer isNeedDailToMember) {
        this.isNeedDailToMember = isNeedDailToMember;
    }

    public String getNormalCallTime() {
        return normalCallTime;
    }

    public void setNormalCallTime(String normalCallTime) {
        this.normalCallTime = normalCallTime;
    }
}
